package com.tx.java.chapter10.exercise10_4.demo2;

/**
 * 说明：
 *  1.内部类可以修改外部类的属性
 *  2.外部类不能访问内部类的private元素
 */
public class OuterClasss {

    private String str ;
    private void print(){
        System.out.println(str);
    }

    public InnerClass getInnerClass(){
        return new InnerClass();
    }

    public void getString(){
        System.out.println(getInnerClass().string);
    }

    public class InnerClass{
        private String string = "1wow";
        public String ss = "1wow";

        void change(String str1){
            str = str1;
            print();
        }
    }
}